home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 February / SGI IRIX 6.5 Complementary Applications 2004 February.iso / dist / cde.idb / usr / dt / share / include / Dt / Dnd.h.z / Dnd.h
Encoding:
C/C++ Source or Header  |  2003-11-18  |  5.1 KB  |  213 lines

  1. /*
  2.  * Dnd.h
  3.  *
  4.  * Copyright 2000, Silicon Graphics, Inc.
  5.  * ALL RIGHTS RESERVED
  6.  * 
  7.  * UNPUBLISHED -- Rights reserved under the copyright laws of the United
  8.  * States.   Use of a copyright notice is precautionary only and does not
  9.  * imply publication or disclosure.
  10.  *
  11.  * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
  12.  * Use, duplication or disclosure by the Government is subject to restrictions
  13.  * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
  14.  * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
  15.  * in similar or successor clauses in the FAR, or the DOD or NASA FAR
  16.  * Supplement.  Contractor/manufacturer is Silicon Graphics, Inc.,
  17.  * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
  18.  *
  19.  * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
  20.  * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
  21.  * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
  22.  * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
  23.  * GRAPHICS, INC.
  24.  */
  25. /* $XConsortium: Dnd.h /main/cde1_maint/1 1995/07/17 18:02:18 drk $ */
  26. /*
  27.  *  (c) Copyright 1993, 1994 Hewlett-Packard Company
  28.  *  (c) Copyright 1993, 1994 International Business Machines Corp.
  29.  *  (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  30.  *  (c) Copyright 1993, 1994 Novell, Inc.
  31.  */
  32.  
  33. #ifndef _Dt_Dnd_h
  34. #define _Dt_Dnd_h
  35.  
  36. #include <Xm/DragIcon.h>
  37. #include <Xm/DragC.h>
  38.  
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42.  
  43.  
  44. /*
  45.  * Constants
  46.  */
  47.  
  48. /* Dnd Callback Reasons */
  49.  
  50. enum {
  51.     DtCR_DND_CONVERT_DATA,
  52.     DtCR_DND_CONVERT_DELETE,
  53.     DtCR_DND_DRAG_FINISH,
  54.     DtCR_DND_TRANSFER_DATA,
  55.     DtCR_DND_DROP_ANIMATE,
  56.     DtCR_DND_ROOT_TRANSFER
  57. };
  58. #define DtCR_DND_TRANSFER DtCR_DND_TRANSFER_DATA
  59.  
  60. /* 
  61.  * Dnd Drag Start Resources 
  62.  *    dropOnRootCallback is private and should not be used
  63.  */
  64.  
  65. #define    DtNdropOnRootCallback        "dropOnRootCallback"
  66. #define    DtCDropOnRootCallback        "DropOnRootCallback"
  67. #define DtNsourceIcon            "sourceIcon"
  68. #define DtCSourceIcon            "SourceIcon"
  69. #define    DtNbufferIsText            "bufferIsText"
  70. #define    DtCBufferIsText            "BufferIsText"
  71.  
  72. /* 
  73.  *Dnd Drop Register Resources
  74.  */
  75.  
  76. #define    DtNdropAnimateCallback        "dropAnimateCallback"
  77. #define    DtCDropAnimateCallback        "DropAnimateCallback"
  78. #define    DtNpreserveRegistration        "preserveRegistration"
  79. #define    DtCPreserveRegistration        "PreserveRegistration"
  80. #define    DtNregisterChildren        "registerChildren"
  81. #define    DtCRegisterChildren        "RegisterChildren"
  82. #define    DtNtextIsBuffer            "textIsBuffer"
  83. #define    DtCTextIsBuffer            "TextIsBuffer"
  84.  
  85. /*
  86.  * Types
  87.  */
  88.  
  89. typedef enum {
  90.     DtDND_SUCCESS,
  91.     DtDND_FAILURE
  92. } DtDndStatus;
  93.  
  94. typedef unsigned long DtDndProtocol;
  95.  
  96. enum {
  97.     DtDND_NOOP_TRANSFER        = 0L,
  98.     DtDND_TEXT_TRANSFER         = (1L << 0),
  99.     DtDND_FILENAME_TRANSFER         = (1L << 1),
  100.     DtDND_BUFFER_TRANSFER         = (1L << 2)
  101. };
  102.  
  103. typedef struct _DtDndBuffer {
  104.         void *        bp;
  105.         int         size;
  106.         String      name;
  107. } DtDndBuffer;
  108.  
  109. typedef struct _DtDndContext {
  110.         DtDndProtocol    protocol;
  111.     Cardinal    numItems;
  112.     union {
  113.         XmString *    strings;
  114.         String *    files;
  115.         DtDndBuffer *    buffers;
  116.     } data;
  117. } DtDndContext;
  118.  
  119.  
  120. /*
  121.  * Dnd Callback Structures
  122.  */
  123.  
  124. typedef struct _DtDndConvertCallbackStruct {
  125.         int         reason;
  126.         XEvent *    event;
  127.         DtDndContext *    dragData;
  128.     DtDndStatus    status;
  129. } DtDndConvertCallbackStruct, *DtDndConvertCallback;
  130.  
  131. typedef struct _DtDndDragFinishCallbackStruct {
  132.     int        reason;
  133.     XEvent *    event;
  134.     DtDndContext *    dragData;
  135.     Widget        sourceIcon;
  136. } DtDndDragFinishCallbackStruct, *DtDndDragFinishCallback;
  137.  
  138. typedef struct _DtDndTransferCallbackStruct {
  139.     int        reason;
  140.     XEvent *    event;
  141.     Position    x, y;
  142.     unsigned char    operation;
  143.     DtDndContext *    dropData;
  144.     Widget        dragContext;
  145.     Boolean        completeMove;
  146.     DtDndStatus    status;
  147. } DtDndTransferCallbackStruct, *DtDndTransferCallback;
  148.  
  149. typedef DtDndTransferCallbackStruct DtDndDropCallbackStruct, *DtDndDropCallback;
  150.  
  151. typedef struct _DtDndDropAnimateCallbackStruct {
  152.     int        reason;
  153.     XEvent *    event;
  154.     Position    x, y;
  155.     unsigned char    operation;
  156.     DtDndContext *    dropData;
  157. } DtDndDropAnimateCallbackStruct, *DtDndDropAnimateCallback;
  158.  
  159.  
  160. /*
  161.  * Functions
  162.  */
  163.  
  164. extern Widget DtDndCreateSourceIcon(
  165.         Widget        widget,
  166.         Pixmap         source,
  167.         Pixmap        mask);
  168.  
  169. extern Widget DtDndDragStart(
  170.         Widget        dragInitiator, 
  171.         XEvent*        event, 
  172.         DtDndProtocol    protocol, 
  173.         Cardinal    numItems, 
  174.         unsigned char    operations,
  175.                 XtCallbackList    convertCallback, 
  176.         XtCallbackList    dragFinishCallback,
  177.         ArgList        argList,
  178.         Cardinal    argCount);
  179.  
  180. extern Widget DtDndVaDragStart(
  181.         Widget        dragInitiator, 
  182.         XEvent*        event, 
  183.         DtDndProtocol    protocol, 
  184.         Cardinal    numItems, 
  185.         unsigned char    operations,
  186.                 XtCallbackList    convertCallback, 
  187.         XtCallbackList    dragFinishCallback,
  188.         ...);
  189.  
  190. extern void DtDndDropRegister(
  191.         Widget        dropSite, 
  192.         DtDndProtocol    protocols, 
  193.         unsigned char    operations, 
  194.                 XtCallbackList    transferCallback,
  195.         ArgList        argList,
  196.         Cardinal    argCount);
  197.  
  198. extern void DtDndVaDropRegister(
  199.         Widget        dropSite, 
  200.         DtDndProtocol    protocols, 
  201.         unsigned char    operations, 
  202.                 XtCallbackList    transferCallback,
  203.         ...);
  204.  
  205. extern void DtDndDropUnregister(
  206.         Widget        widget);
  207.  
  208. #ifdef __cplusplus
  209. }
  210. #endif
  211.  
  212. #endif /* _Dt_Dnd_h */
  213.